package com.calm.singleton;

import android.util.Log;

public class DoubleCheckSingleton {
    private static final String TAG = DoubleCheckSingleton.class.getSimpleName();
    private DoubleCheckSingleton(){
        Log.e(TAG,"DoubleCheckSingleton init");
    }
    private static volatile DoubleCheckSingleton INSTANCE;
    public static DoubleCheckSingleton getInstance(){
        if(INSTANCE == null){
            synchronized (DoubleCheckSingleton.class){
                if(INSTANCE == null){
                    INSTANCE = new DoubleCheckSingleton();
                }
            }
        }
        return INSTANCE;
    }
    public void sayHello(String name){
        Log.e(TAG,"Hello "+name+",nice to meet you !");
    }
}
